import 'package:flutter/material.dart';

/// todo：Flutter原始页面跳转
/// [page] 路由别名，[context] 上下文
Future<dynamic> jumpPage({@required Widget page, @required BuildContext ctx}) async {
  var call = await Navigator.of(ctx).push(
    MaterialPageRoute(
      builder: (buildContext) => page,
    ),
  );
  if (call != null) return call;
}

/// todo：Flutter原始路由跳转
/// [router] 路由别名，[arguments] 传递的参数，[context] 上下文
Future<dynamic> jumpRouter(String router, {dynamic arguments, @required BuildContext context}) async {
  var call = await Navigator.pushNamed(
    context,
    router,
    arguments: arguments,
  );
  if (call != null) return call;
}
